/**
 *  ward @ 2019
 *  harrydeep@wardyan.top
 */
package top.wardyan.po;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;

import top.wardyan.base.config.Const;

/**
 * 
 * @author ward 2019年2月24日
 */
public class WComposite extends Composite{
	
	/** 返回最右下角的那个点 **/
	protected Point bottom;
	
	
	public WComposite(Composite parent) {
		this(parent, null, Const.COLOR_WHITE);
		
	}
	
	public WComposite(Composite parent, Rectangle bound) {
		this(parent, bound, Const.COLOR_WHITE);
	}
	
	public WComposite(Composite parent, Rectangle bound, Color background) {
		super(parent, SWT.NONE);
		this.setBackground(Const.COLOR_WHITE);
		if(bound != null)
			this.setBounds(bound);
		
		this.setBottom();
	}
	
	/** 取得控件的最右下角的那个点 **/
	public Point getBottom() {
		return this.bottom;
	}
	
	protected void setBottom() {
		this.bottom = new Point(this.getLocation().x + this.getSize().x, this.getLocation().y + this.getSize().y);
	}

	
	@Override
	protected void checkSubclass() {}
}
